const model = require("../utils/userSchema")

// 使用id查找记录
const findId = async (_id) => {
  return await model.findOne({ _id })
}

// 更新博客
const update = async (_id, str) => {
  const { blog } = await findId(_id)
  blog.push(str)
  console.log(blog);
  return await model.updateOne({ _id }, {
    $set: {
      blog
    }
  })
}

module.exports = { findId, update }